<template>
    <Org
            single-name="角色"
            del-message="此操作将永久删除该角色, 是否继续?"
            :list-url="prefix + '/list'"
            :users-url="prefix + '/getUsers'"
            :add-user-url="prefix + '/addUser'"
            :del-user-url="prefix + '/delUser'"
            :save-url="prefix + '/save'"
            :del-url="prefix + '/del'"
            :search-user-url="userPrefix + '/list'"
            :export-url="prefix + '/export'"
            :import-url="prefix + '/imt'"
            :allow-children="false"
            tag-key="roleTags"
            btn-root-text="添加角色"
            :types="{USER:'用户'}"
    >
        <template slot="action" slot-scope="r" v-if="true">
            <i class="el-icon-menu" @click="methodPermission(r.data)"></i>
        </template>
    </Org>
</template>

<script>
    import Org from "../components/Org";

    export default {
        props:{
            dialogVisible: false,
            prefix: {
                type: String,
                default: "/role"
            },
            userPrefix: {
                type: String,
                default: "/user"
            }
        },
        components: {Org},
        data() {
            return {}
        },
        methods:{
            methodPermission(r){
                console.log(r)
                this.$router.push({"name":"menuAuthority",query:{id:r.id}})
                // top.addNavTab && top.addNavTab(
                //     r.id
                //     , r.name + "功能权限"
                //     , "/htmlsrc/sysManage/authority/menuAuthority?roleid=" + r.id
                // )
            }
        }
    }
</script>
<style scoped>
    .el-icon-menu{
        color: #409EFF;
        cursor: pointer;
        font-size: 16px;
        margin-right: 10px;
    }
</style>